package com.itany.corejava.code07_面向对象.租车系统;

/**
 * @author: 石小俊
 * @date: 2023年03月09日 11:11
 * @version: 1.0
 */
public class Bus extends MotorVehicle {

    private int seatCount; // 座位数

    public Bus() {
    }

    public Bus(String no, String brand, int seatCount) {
        super(no, brand);
        this.seatCount = seatCount;
    }

    public int getSeatCount() {
        return seatCount;
    }

    public void setSeatCount(int seatCount) {
        this.seatCount = seatCount;
    }

    /**
     * 客车的租金方法
     * @param day 租车的天数
     * @return 总租金
     */
    @Override
    public double rent(int day) {
        int sum = 0;
        if (seatCount <= 30) {
            sum = 1000 * day;
        } else {
            sum = 2000 * day;
        }
        return sum;
    }
}
